package com.cc.service.iml;

import com.cc.mapper.ProductCategoryMapper;
import com.cc.model.EbProductCategory;
import com.cc.service.ProductCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class EbProductCategoryServiceImpl implements ProductCategoryService {
    @Autowired
    private ProductCategoryMapper productCategoryMapper;

    @Override
    public List<EbProductCategory> list(Integer page, Integer pageSize) {
        return productCategoryMapper.findByPage((page-1)*pageSize,pageSize);
    }

    @Override
    public int save(EbProductCategory ebProductCategory) {
        return productCategoryMapper.save(ebProductCategory);
    }

    @Override
    public int getMaxPage(int pageSize) {
        return productCategoryMapper.getMaxPage(pageSize);
    }

    @Override
    public int deleteByPk(int eoId) {
        return productCategoryMapper.delete(eoId);
    }

    @Override
    public EbProductCategory selectByCondition(int eoId) {
        return productCategoryMapper.findById(eoId);
    }

    @Override
    public int updateById(EbProductCategory ebProductCategory) {
        return productCategoryMapper.updateByPrimaryKey(ebProductCategory);
    }

    @Override
    public List<EbProductCategory> findBigProductCategory() {
        return productCategoryMapper.findBigProductCategory();
    }

    @Override
    public List<EbProductCategory> findSmallProductCategory() {
        return productCategoryMapper.findSmallProductCategory();
    }

}
